package com.torfox.services;

import java.util.Date;
import java.util.List;

import com.torfox.entities.LogRecord;

/**
 * Facade for {@link LogRecord} search and manipulation
 * @author Bartosz Jankiewicz
 */
public interface ILoggingService
{

	/**
	 * Return recent logs in given amount
	 * @param limit Number of records
	 * @return Returns list of {@link LogRecord} objects
	 */
	List<LogRecord> getLogs(int limit);

	List<LogRecord> getLogs(int limit, String filterLevel, String pattern);

	/**
	 * List of recognized level types
	 * @return Returns list of String representation of level/priority values
	 */
	List<String> getLevels();

	/**
	 * Finds exception class names matching given pattern
	 * @param pattern Pattern matching exception name fragment
	 * @return List of matching exception names
	 */
	List<String> getExceptions(String pattern);

	LogRecord getLogRecord(Long recordId);

	List<LogRecord> getLogs(int limit, Date dateStart, Date dateEnd,
			final String sender,
			String filterLevel,
			String messagePattern,
			String classPattern,
	        String exceptionPattern);

	/**
	 * All senders
	 * @return All senders list
	 */
	List<String> getSenders();

}
